import java.lang.String;

public class Five {
    public static void main(String[] args) {
        if (args.length < 1)
            return;

        String result = compress(args[0]);
        System.out.println(result);
    }

    private static String compress(String s) {
        char[] chs = s.toCharArray();
        StringBuffer sb = new StringBuffer();
        int count = 0;
        for(char ch : chs) {
            if (sb.length() == 0) {
                sb.append(ch);
                count++;
            } else if (ch == sb.charAt(sb.length()-1))
                count++;
            else {
                sb.append(count);
                count = 1;
                sb.append(ch);
            }
        }

        sb.append(count);

        String result = sb.toString();
        if (result.length() >= s.length())
            return s;
        else
            return result;
    }

    private static String compress2(String s) {
        return s; 
    }
}
